<!DOCTYPE html>
<html lang="en">
<head>
	<title></title>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="stylesheet" href="__CSS__/bootstrap.min.css" />
	<link rel="stylesheet" href="__CSS__/bootstrap-responsive.min.css" />
	<link rel="stylesheet" href="__CSS__/uniform.css" />
	<link rel="stylesheet" href="__CSS__/select2.css" />
	<link rel="stylesheet" href="__CSS__/matrix-style2.css" />
	<link rel="stylesheet" href="__CSS__/matrix-media.css" />
	<link href="__FONT__/css/font-awesome.css" rel="stylesheet" />
	<link rel="stylesheet" href="__CSS__/changyun.css" />
	<style>
		.table th,.table td{line-height: 20px;text-align: center;border-top: 1px solid #ddd;padding:5px 0 5px 10px;vertical-align: middle;}
	</style>
</head>
<body>
<div id="content">
	<include file="Public/maintop" />
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-content" style="padding:5px;border:0px;">
						<form action="__ACTION__" method="get">
							<div class="fr table-button">
								<button type="submit" class="btn btn-success"><i class="icon-search"></i> 搜索</button></div>
							<div class="fr table-button">
								<select style="width:150px;" name="status">
									<option value="0">==状态==</option>
									<option value="1" <if condition="1 eq $gget['status']">selected</if> >已联系</option>
									<option value="-1" <if condition="-1 eq $gget['status']">selected</if> >待联系</option>
								</select>
								<input type="text" name="complaint_phone" placeholder="请输入手机号" value="{#$gget.complaint_phone}">
							</div>
						</form>
					</div>
					<div class="widget-content" style="padding:5px;">
						<table class="table table-bordered table-striped with-check" style="margin-bottom: 0px;">
							<thead>
							<tr>
								<th width="30" style="text-align: center;"><input type="checkbox" class="tpl-table-fz-check" id="all_check"></th>
								<th width="50" style="text-align:center;">ID</th>
								<th width="60" style="text-align:center;">投诉人</th>
								<th width="60" style="text-align:center;">投诉文章</th>
								<th width="60" style="text-align:center;">投诉原因</th>
								<th width="60" style="text-align:center;">投诉描述</th>
								<th width="60">投诉人手机号</th>
								<th width="80">状态</th>
								<th width="60">创建时间</th>
								<th width="60">更新时间</th>
							</tr>
							</thead>
							<tbody>
							<notempty name="list_data.list_data">
								<volist name="list_data.list_data" id="data">
									<tr class="text-c">
										<td style="text-align: center;"><input type="checkbox" name="check_id" value="{#$data.id}" /></td>
										<td align="center">{#$data.id}</td>
										<td>
											<div rel="pop" style="display: flex">
												<img style="width: 40px;height: 40px;border-radius: 50%;border:1px solid #efefef;" src="{#$data.user_headimg}"><br>
												{#$data.user_nickname}
											</div>
										</td>
										<td style="color:#ff0000;">
											<span>ID：{#$data.article_id}</span>
										</td>
										<td>{#$data.complaint_reason}</td>
										<td>{#$data.complaint_des}</td>
										<td>{#$data.complaint_phone}</td>
										<td>
											<if condition="$data.status ==1">
												<a href="javascript:void(0);" class="btn btn-mini btn-success">已联系</a>
												<else/>
												<a href="javascript:void(0);" onclick="updateStatus({#$data['id']},'status',1,'已联系')" class="btn btn-mini btn-danger"><i class="icon-cog"></i> 待联系</a>
											</if>
										</td>
										<td>{#$data.add_time|time_format}</td>
										<td>{#$data.update_time|time_format}</td>
									</tr>
								</volist>
								<else/>
								<td colspan="7" class="text-center"> 暂时还没有信息! </td>
							</notempty>
							</tbody>
						</table>
						<div id="hongxin_page_view">{#$list_data._page}</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.ui.custom.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.uniform.js"></script>
<script src="__JS__/select2.min.js"></script>
<script src="__JS__/matrix.js"></script>
<script src="__JS__/matrix.tables.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/action.js"></script>

<script>
function updateStatus(id,faild,status, message) {
	layer.confirm('确定要更新状态为' + message + '吗', {
		title: '提示',
		icon: 0,
		btn: ['确定', '取消'] //按钮
	}, function(e) {
		layer.close(e);
		var loadi = null;
		loadi = layer.load(2);
		$.ajax({
			type:"GET",
			data:{aid:id,field:faild,status:status,_:Date.now()},
			dataType:"json",
			url:"{#:U('setStatus')}",
			success:function(rdata){
				layer.close(e);
				layer.close(loadi);
				if(rdata.status == 1){
					layer.alert(rdata.msg,{icon: 1},function () {
						window.location.reload();
					});return false;
				}else{
					layer.alert(rdata.msg,{icon: 0});return false;
				}
			}
		});
	}, function(e) {
		layer.close(e);
	});
}

</script>
</body>
</html>
